package com.woniu.outlet.mysql.po;

import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.data.redis.core.RedisHash;

import java.math.BigDecimal;

@RedisHash
@Document(indexName = "products", shards = 1, replicas = 1)
public class Product {
    @Id
    @Field(type = FieldType.Keyword)
    private Integer id;

    @Field(type = FieldType.Text, analyzer = "ik_smart")
    private String name;

    @Field(type = FieldType.Keyword)
    private String description;

    @Field(type = FieldType.Double)
    private BigDecimal yieldrate;

    @Field(type = FieldType.Double)
    private BigDecimal startmoney;

    @Field(type = FieldType.Keyword)
    private String type;

    @Field(type = FieldType.Keyword)
    private String datestr;

    @Field(type = FieldType.Integer)
    private Integer expire;

    @Field(type = FieldType.Keyword)
    private String risk;

    @Field(type = FieldType.Keyword)
    private String status;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name == null ? null : name.trim();
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description == null ? null : description.trim();
    }

    public BigDecimal getYieldrate() {
        return yieldrate;
    }

    public void setYieldrate(BigDecimal yieldrate) {
        this.yieldrate = yieldrate;
    }

    public BigDecimal getStartmoney() {
        return startmoney;
    }

    public void setStartmoney(BigDecimal startmoney) {
        this.startmoney = startmoney;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type == null ? null : type.trim();
    }

    public String getDatestr() {
        return datestr;
    }

    public void setDatestr(String datestr) {
        this.datestr = datestr == null ? null : datestr.trim();
    }

    public Integer getExpire() {
        return expire;
    }

    public void setExpire(Integer expire) {
        this.expire = expire;
    }

    public String getRisk() {
        return risk;
    }

    public void setRisk(String risk) {
        this.risk = risk == null ? null : risk.trim();
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status == null ? null : status.trim();
    }
}